//货柜与商品-商品列表
App.util.ns('Client.Feedback');
App.pages.add((function(){
    var NS = Client.Feedback;
    var page = new App.Page({
        name: 'client/feedback/index'
    });
    //页面初始化
    page.initStack.add('dataTable', function(){
        //面包屑导航
        this.setBreadcrumb([{
            icon: '<i class="fa fa-question-circle-o"></i>',
            content: '意见反馈'
        }, {
            content: '反馈列表'
        }]);
        this.dataTable = new App.DataTable({
            baseUrl: '/client/feedback',
            dataUrl: 'lists',
            table: {
                id: 'id',
                main: 0,
                columns: App.util.copy(NS.Conf.columns)
            },
            filter: [
                {type: 'keywords'},
                {type: 'timeRange'},
                {type: 'select', name: 'status', title: '类型', width: '120px', items: [
                    [1, '提意见'],
                    [2, '申请中医']
                ]},
                {type: 'select', name: 'status', title: '状态', width: '120px', items: [
                    [0, '未处理'],
                    [1, '已处理']
                ]}
            ],
            menu: [
                {parent: 'add', permission: 'op:client.feedback.feedback.create'},
                {parent: 'view', permission: 'op:client.feedback.feedback.detail'},
                {parent: 'edit', permission: 'op:client.feedback.feedback.update'},
                {type: 'inline', permission: 'op:client.feedback.feedback.finish', name: '处理完成', operation: {type: 'change', url: 'finish'}, conditions: [['status', '0']]},
                {parent: 'drop', permission: 'op:client.feedback.delete'},
                {type: 'multi', name: '状态', openable: true, permission: 'op:client.feedback.feedback.multiFinish', items: [{
                        type: 'multi', permission: 'op:clientfeedback.feedback.multiOnline', name: '处理完成', operation: {
                        type: 'change', url: 'multiFinish', confirm: true
                    }}]
                },
                {parent: 'multiDrop', permission: 'op:client.feedback.feedback.multiDelete'},
                {parent: 'oplog', permission: 'op:client.feedback.feedback.getOpLogs'}
            ],
            detail: {
                form: {
                    items: App.util.copy(NS.Conf.form)
                }
            }
        }, page);
        this.dataTable.fix(this.contentContainer);
        this.dataTable.loadData();
    });
    //页面刷新
    page.refreshStack.add('dataTable', function(){
        this.dataTable.loadData(true);
    });
    //页面销毁
    page.destroyStack.add('dataTable', function(){
        this.dataTable.destroy();
    });
    return page;
})());